﻿<UserControl
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero" 
             x:Class="Edutainment.BubbleSortExerciseWindow" 
             mc:Ignorable="d" 
             Height="273.677" Width="960" Foreground="#FF282828">
    <UserControl.Resources>
        
        <SolidColorBrush x:Key="WrongSelectionBrush" Color="#CC8B0000"/>
        <SolidColorBrush x:Key="SortationDoneBrush" Color="#CC006400"/>
        <SolidColorBrush x:Key="NormalBrush" Color="#66F4F4F5" />

        <Style x:Key="MyFocusVisual">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Control}">
                        <Grid Margin="3 2">
                            <Rectangle x:Name="r1" StrokeThickness="1" Stroke="Black" StrokeDashArray="2 2"/>
                            <Border x:Name="border" Width="{TemplateBinding ActualWidth}" Height="{TemplateBinding ActualHeight}"  CornerRadius="2" BorderThickness="1" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>


        <Style x:Key="ShadowStyle">
            <Setter Property="Control.Foreground" Value="LightGray" />
        </Style>

        <Style x:Key="InformButton" TargetType="{x:Type ToggleButton}" >
            <Setter Property="OverridesDefaultStyle" Value="True"/>
            <Setter Property="Margin" Value="2"/>
            <Setter Property="FontFamily" Value="Segoe UI Light"/>
            <Setter Property="FontSize" Value="40px"/>
            <Setter Property="FontWeight" Value="Light"/>
            <Setter Property="Foreground" Value="#092740"/>
            <!-- <Setter Property="FocusVisualStyle" Value="{StaticResource MyFocusVisual}" /> -->
            <Setter Property="Background" Value="#66F4F4F5" />

            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ToggleButton}">
                        <Border x:Name="border" BorderThickness="3" Padding="4,2" 
				BorderBrush="{DynamicResource borderColor}" Background="{TemplateBinding Background}">
                            <Grid >
                                <ContentPresenter HorizontalAlignment="Center" 
                            VerticalAlignment="Center" x:Name="content"/>
                            </Grid>
                        </Border>

                        <ControlTemplate.Triggers>
                            <Trigger Property="IsChecked" Value="True">
                                <Trigger.EnterActions>
                                    <BeginStoryboard>
                                        <Storyboard>
                                            <ThicknessAnimation Storyboard.TargetProperty="BorderThickness"  FillBehavior="HoldEnd" From="3,3,3,3" To="5,5,5,5" Duration="0:0:1" RepeatBehavior="Forever" AutoReverse="True"/>
                                        </Storyboard>
                                    </BeginStoryboard>
                                </Trigger.EnterActions>
                                <Setter TargetName="border" Property="BorderBrush" Value="#FFFFB900" />
                            </Trigger>

                            <Trigger Property="IsEnabled" Value="False">
                                <Setter TargetName="border" Property="Opacity" Value="0.7" />
                                <Setter Property="Foreground" Value="Gray" />
                            </Trigger>

                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>


        <Style x:Key="ButtonFocusVisual">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
            <GradientStop Color="#F3F3F3" Offset="0"/>
            <GradientStop Color="#EBEBEB" Offset="0.5"/>
            <GradientStop Color="#DDDDDD" Offset="0.5"/>
            <GradientStop Color="#CDCDCD" Offset="1"/>
        </LinearGradientBrush>
        <SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/>
        <Style x:Key="LabelButton" TargetType="{x:Type Button}">
            <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
            <Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
            <Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Padding" Value="1"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Microsoft_Windows_Themes:ButtonChrome x:Name="Chrome" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}" RenderDefaulted="{TemplateBinding IsDefaulted}" SnapsToDevicePixels="true" RoundCorners="False" IsEnabled="False">
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Microsoft_Windows_Themes:ButtonChrome>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsKeyboardFocused" Value="true">
                                <Setter Property="RenderDefaulted" TargetName="Chrome" Value="true"/>
                            </Trigger>
                            <Trigger Property="ToggleButton.IsChecked" Value="true">
                                <Setter Property="RenderPressed" TargetName="Chrome" Value="true"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Foreground" Value="#ADADAD"/>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="true">
                                <Setter Property="Foreground" Value="LightGreen"/>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="false">
                                <Setter Property="Foreground" Value="White"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <Grid Margin="0,0,0,0">
        <!--<Grid x:Name="ButtonPositionGrid" Margin="115,216,115,0" Height="152" VerticalAlignment="Top" Background="#FFD83C3C"/> -->
        <Label Content="Sortiere die Liste mittels Buttons" Canvas.Left="2" Canvas.Top="-47" Background="{x:Null}" Foreground="#FFF0F4F7" FontSize="24" FontFamily="Segoe UI Light" VerticalAlignment="Top" HorizontalAlignment="Left" Width="361" Margin="7,33,0,0" Opacity="0.8"/>

        <Canvas x:Name="ButtonPositionCanvas" Margin="2,57.5,-2,0" Height="212" VerticalAlignment="Top" >
        </Canvas>
        <Image Height="39.126" Canvas.Left="8" Source="../logo_birne.png" Stretch="Fill" Width="39.281" Canvas.Top="149.925" Opacity="0.8" HorizontalAlignment="Left" Margin="17.719,0,0,20.008" VerticalAlignment="Bottom" Cursor="Hand"/>
        <Button x:Name="tipButton" Content="Nächsten Schritt anzeigen" HorizontalAlignment="Left" Margin="61,214.04,0,0" VerticalAlignment="Top" Width="250" Click="tipButtonClicked" d:LayoutOverrides="HorizontalAlignment" Height="42.96" Style="{DynamicResource LabelButton}" Background="{x:Null}" BorderBrush="{x:Null}" Opacity="0.8" FontSize="21.333" FontFamily="Segoe UI Light" Cursor="Hand"/>

    </Grid>
</UserControl>
